<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCourierInformationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('courier_information', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('courier_company_id')->index()->comment('快递公司 ID');
            $table->string('tracking_numbering')->default('')->comment('快递单号');

            $table->bigInteger('deliverable_id')->index()->comment('拥有这个快递信息的 ID');
            $table->string('deliverable_type')->comment('拥有这个快递信息的模型');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('courier_information');
    }
}
